package com.woniuxy.microgatewayserver.controller;

import com.alibaba.fastjson.JSONObject;
import com.woniuxy.microgatewayserver.entity.ResultMsg;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Auther: wuson  <br/>
 * Date: 2021/3/11:14:15  <br/>
 * Description:
 */
@RefreshScope
@RestController
public class FallBackController {

    @RequestMapping(value = "/fallback", produces = MediaType.APPLICATION_JSON_VALUE)
    public String fallback() {
        return JSONObject.toJSONString(ResultMsg.builder().code(9000).msg("网关降级，请稍后重试！").build());

    }
}
